import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from "@/views/Login.vue";
import Main from "@/components/Main.vue";
import Home from "@/views/Home.vue";
import User from "@/views/User.vue";
import Meeting from "@/views/Meeting.vue";
import Meeting2 from "@/views/Meeting2.vue";
import Bulletin from "@/views/Bulletin.vue";
import Bulletin2 from "@/views/Bulletin2.vue";
import Leave from "@/views/Leave.vue";
import Reimbursement from "@/views/Reimbursement.vue";
import Overtime from "@/views/Overtime.vue";
import Approval from "@/views/Approval.vue";
import Salary from "@/views/Salary.vue";
import Sign from "@/views/Sign.vue";
import Recruitment from "@/views/Recruitment.vue";
import Schedule from "@/views/Schedule.vue";
import ScheduleDetail from "@/views/ScheduleDetail.vue";
import Statistics from "@/views/Statistics.vue";
import Attendance from "@/views/Attendance.vue";
import Attendance2 from "@/views/Attendance2.vue";
import Info from "@/views/Info.vue";

Vue.use(VueRouter)

const routes = [{
    path: '/', name: 'main', component: Main, redirect: '/home', //重定向
    children: [//子路由
        {path: '/home', name: 'home', component: Home}, //首页
        {path: '/user', name: 'user', component: User}, //用户信息
        {path: '/meeting', name: 'meeting', component: Meeting}, //会议信息(管理员
        {path: '/meeting2', name: 'meeting2', component: Meeting2}, //会议查看
        {path: '/bulletin', name: 'bulletin', component: Bulletin}, //公告信息(管理员
        {path: '/bulletin2', name: 'bulletin2', component: Bulletin2}, //公告信息
        {path: '/leave', name: 'leave', component: Leave}, //请假信息
        {path: '/reimbursement', name: 'reimbursement', component: Reimbursement}, //补卡信息
        {path: '/overtime', name: 'overtime', component: Overtime}, //加班信息
        {path: '/approval', name: 'approval', component: Approval}, //审批信息
        {path: '/salary', name: 'salary', component: Salary}, //薪资信息
        {path: '/recruitment', name: 'recruitment', component: Recruitment}, //招聘信息
        {path: '/sign', name: 'sign', component: Sign}, //打卡
        {path: '/schedule', name: 'schedule', component: Schedule}, //排班管理
        {path: '/scheduleDetail', name: 'scheduleDetail', component: ScheduleDetail}, //排班详细管理
        {path: '/attendance', name: 'attendance', component: Attendance}, //考勤管理(管理员
        {path: '/statistics', name: 'statistics', component: Statistics}, //考勤统计(管理员
        {path: '/attendance2', name: 'attendance2', component: Attendance2}, //考勤查看
        {path: '/info', name: 'info', component: Info}, //个人信息
    ]
}, {
    path: '/login', name: 'login', component: Login
}]

const router = new VueRouter({
    mode: 'history', base: process.env.BASE_URL, routes
})

export default router
